(let ([x (cons 1 2)]) (begin (set-cdr! x ()) x))
=> (1)
(let ([x (cons 1 2)]) (set-cdr! x ()) x)
=> (1)
(let ([x (cons 12 13)] [y (cons 14 15)]) (set-cdr! x y) x)
=> (12 14 . 15)
(let ([x (cons 12 13)] [y (cons 14 15)]) (set-cdr! y x) y)
=> (14 12 . 13)
(let ([x (cons 12 13)] [y (cons 14 15)]) (set-cdr! y x) x)
=> (12 . 13)
(let ([x (cons 12 13)] [y (cons 14 15)]) (set-cdr! x y) y)
=> (14 . 15)
(let ([x (let ([x (cons 1 2)]) (set-car! x #t) (set-cdr! x #f) x)]) (cons x x) x)
=> (#t . #f)
(let ([x (cons 1 2)]) (set-cdr! x x) (set-car! (cdr x) x) (cons (eq? x (car x)) (eq? x (cdr x))))
=> (#t . #t)
(let ([x #f]) (if (pair? x) (set-car! x 12) #f) x)
=> #f